﻿Imports System.Xml

Public Class GeometryPathType
	Public Sub New()
		Me.PathPoints = New List(Of PathPointType)
	End Sub

	Property PathOpen As Boolean

	Property PathPoints As List(Of PathPointType)

	Public Shared Function ReadXml(reader As XmlReader) As GeometryPathType
		Dim gpt As New GeometryPathType()

		If reader.HasAttributes Then
			gpt.PathOpen = CBool(reader.GetAttribute("PathOpen"))
		End If

		While reader.Read()
			If reader.Name = "PathPointType" Then
				gpt.PathPoints.Add(PathPointType.ReadXml(reader))
			ElseIf reader.Name = "GeometryPathType" And reader.NodeType = XmlNodeType.EndElement Then
				Exit While
			End If
		End While

		Return gpt
	End Function
End Class
